home *** CD-ROM | disk | FTP | other *** search
- /*
- * AudioCompressor.h
- *
- * Copyright (C) Alberto Vigata - January 2000 - ultraflask@yahoo.com
- *
- * This file is part of FlasKMPEG, a free MPEG to MPEG/AVI converter
- *
- * FlasKMPEG is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * FlasKMPEG is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
- #ifndef AUDIO_COMPRESSOR_H
- #define AUDIO_COMPRESSOR_H
-
- #include "..\..\Misc\CArray.h"
-
- #define INTEGER_COMPRESSOR_SIZE 65536
- #define COMPRESSOR_BOTTOM -32767
- #define COMPRESSOR_TOP 32768
-
- #define DEFAULT_KNOTS 3
- #define DB_RANGE 92
- #define COMPRESSOR_STEPS 10
- #define DEFAULT_STEP 5
-
- struct TKnot
- {
- float in_dBLevel;
- float out_dBLevel;
- };
-
-
- class CAudioCompressor
- {
- public:
- int Compress(short *data, int samples_count);
- int CreateCompressor();
- CAudioCompressor();
- ~CAudioCompressor();
-
- private:
- int RenderCompressor();
- int AdjustKnots(int step);
- CArr<TKnot> knots;
- short* comp_lut;
- };
-
-
- #endif
-
-
-